<template>
  <view>
       <view class="search-container" :style="{backgroundColor:bgColor}">
          <view class="search-box" @click="gotoSearch" :style="{borderRadius:radius + 'px'}">
             <uni-icons type="search" size="17"></uni-icons>
             <text class="placeholder">搜索</text>
          </view>
       </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props:{
      bgColor:{
         type:String,
         default:"#c00000"
      },
      radius:{
        type:Number,
        default:18
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      gotoSearch () {
         console.log('ok');
         this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
.search-container {
   // background-color: #c00000;
   height: 50px;
   padding: 0 10px;
   display: flex;
   align-items: center;
   .search-box{
     height: 36px;
     background-color: #fff;
     // border-radius: 15px;
     width: 100%;
     display: flex;
     justify-content: center;
     align-items: center;
     .placeholder {
       font-style: 13px;
       margin-left: 5px;
     }
     
   }
}
</style>